/* ============================================================
   reset.scss —— Vue 3 项目专用通用重置样式
   目标：
   1️⃣ 去除浏览器默认样式差异；
   2️⃣ 保持语义与可访问性；
   3️⃣ 避免与 UI 库冲突；
   ============================================================ */

/* --- 通用设置 --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- HTML & BODY 基础 --- */
html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-size: 16px;
  line-height: 1.5;
}

body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    'Noto Sans',
    'Liberation Sans',
    'PingFang SC',
    'Microsoft YaHei',
    sans-serif;
  color: #333;
  background-color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Vue 挂载点（防止 layout 抖动） */
#app {
  min-height: 100%;
  isolation: isolate;
}

/* --- 标题 / 文本 --- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

p {
  margin: 0;
}

/* --- 链接 --- */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* --- 图片与媒体 --- */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- 列表 --- */
ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* --- 表格 --- */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* --- 表单 --- */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

/* 移除浏览器特有样式 */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='search'] {
  -webkit-appearance: textfield;
  outline-offset: -2px;
}

input[type='search']::-webkit-search-decoration {
  -webkit-appearance: none;
}

/* placeholder 一致性 */
::placeholder {
  color: #aaa;
  opacity: 1;
}

/* --- 代码块 --- */
code,
pre {
  font-family: 'Fira Code', Consolas, monospace;
}

/* --- 焦点可见状态 --- */
:focus-visible {
  outline: 2px solid #409eff;
  outline-offset: 2px;
}

/* --- 动画简化（尊重系统设置） --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- 滚动条美化 (可选) --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.35);
}
